<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>样式绑定与处理</title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
		<style type="text/css">
			.ball{
				width: 200px;
				height: 200px;
				border-radius: 50%;
			}
			.ballColor{
				background-color: #FF69B4;
			}
			.ballBorder{
				border: 5px solid #7FFFD4;
			}
		</style>
	</head>
	<body>
		<div id="box"><!-- @mouseover鼠标移入 @mouseout鼠标移出 -->
			<div 
			:class="ballClass" 
			@mouseover="ballClass.ballBorder=false"
			@mouseout="ballClass.ballBorder=true"
			:style="ballCon">球</div>
		</div>
		<script type="text/javascript">
			const vm = new Vue({
				el:'#box',
				data:{
					ballClass:{//样式的第三种写法，方便随时修改
						ball:true,
						ballColor:true,
						ballBorder:true
					},
					ballCon:{//style的用法
						'text-align':'center',
						'line-height':'200px',
						'font-size':'20px',
					}
				}
			})
		</script>
	</body>
</html>
